package cac.fenjian.resource.dispatchSearch.dao;

import cac.fenjian.resource.MsDeliveryPackageInfo.dto.MsDeliveryPackageInfoDTO;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

public interface MsDeliveryPackageInfoDao {


    //配送物料查询信息
    List<HashMap> deliveryMaterial(@Param("map") HashMap queryParam);
    List<String> selectMaterialIsOnCar(@Param("map") HashMap map);

    List<HashMap> waitingDispatch(@Param("map") HashMap queryParam);
    List<HashMap> queryNoDaliyTimeAoByCarCode(@Param("map") HashMap map);
    List<HashMap> querySendMaterial(@Param("map") HashMap map);
    //新增配送信息
    public Integer insertInfoParams(MsDeliveryPackageInfoDTO msDeliveryPackageInfoDTO);

    //判断是否唯一
    public String searchIsNull(String msWorkbinMaterialId);

    //增加交接单信息
    public int insertDeliveryPackageInfo(@Param("map") HashMap map);

    //新增小车绑定物料工作器具包id
    public HashMap callCarCodeBle(HashMap map);

    //修改matchInfo配送状态
    public int updateMatchInfo(@Param("toolCodes") String toolCodes,@Param("opUserCode") String opUserCode,@Param("IP") String IP);

    //查询当前托盘对应的ao是否全部配送
    public HashMap selectAoDeliveryState(String toolCode);

    //修改AO为全部配送
    public int updateTaskAoAll(@Param("map")HashMap map);

    //修改AO为部分配送
    public int updateTaskAoPart(String toolCode);

    //修改工作包为全部配送
    public int updatePackageAll(@Param("map")HashMap map);
    //修改工作包为全部配送
    public int updatePackagePart(@Param("map")HashMap map);

    //查询工作包下托盘信息
    public HashMap selectByPackageCode(String packageCode);

    //查询配送任务数量信息
    public HashMap countSearch(String time);

    //分拣出库占用查询
    public List<HashMap> sortingInvOut(String toolcode);

    String queryHgzNo(@Param("wmsInvOutAllotmentId") String wmsInvOutAllotmentId);
    //配送修改台账
    public int upInventory(@Param("map") HashMap map);

    //配送新增流水
    public int insertTransaction(@Param("map") HashMap map,@Param("hgzNo") String hgzNo);

    //配送之后修改占用表状态
    public int updateAllotment(@Param("map") HashMap map);

    //查询修改流水表的数据
    public HashMap searchInventory(@Param("map") HashMap map);

    //配送上传状态
    public List<String> deliveryStatus(String toolcode);

    //定时上传配送状态数据
    public List<HashMap> dateDeliveryStatus();

    int updateWorkBin(@Param("palletCode")String palletCode);
    //查询未配送小车组号
    String getCarGroupCode(@Param("carCode") String carCode);

    int updateWorkbinCar(@Param("carCode") String carCode);

    int updateWorkbinCarByDeliveryPlanId(@Param("wmsDeliveryPlanId") String wmsDeliveryPlanId,@Param("groupCode") String groupCode);
    int updateOnCarByDeliveryPlanId(@Param("wmsDeliveryPlanId") String wmsDeliveryPlanId,@Param("groupCode") String groupCode);
    int udpateDeliveryGroupCode(@Param("wmsDeliveryPlanId") String wmsDeliveryPlanId,@Param("groupCode") String groupCode);
    //判断当前托盘是否已经装车
    int queryToolIsOnCar(@Param("palletCode")String palletCode,@Param("carCode") String carCode);
    //判断小车里面的工作包是否存在未下发日计划的
    int queryPackageExistsDaliyPlan(@Param("carCode") String carCode);
    //获取未下日计划的AO
    String queryAoNotExistsDaily(@Param("carCode") String carCode);

    int insertDeliveryRepeat(@Param("groupCode") String groupCode);
    int queryRepeatCnt(@Param("groupCode") String groupCode);
    List<HashMap> checkBillQtyAndPackageQty(@Param("msAoMatchBillId") String msAoMatchBillId);
    List<HashMap> querySendBillId(@Param("groupCode") String groupCode);

    int clearDeliveryRepeatCheck(@Param("groupCode") String groupCode);

    int queryIsExistsTransaction(@Param("map") HashMap map);
}
